package com.spring.common.web.controller;

import javax.annotation.Resource;

import com.fasterxml.jackson.databind.util.JSONPObject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mangofactory.swagger.annotations.ApiIgnore;
import com.spring.common.web.model.CommonOa;
import com.spring.common.web.service.CommonOaService;
import com.spring.security.core.util.ApplicationUtils;
import com.spring.tools.Result;

@Controller
@RequestMapping(value = "/commonOa")
@ApiIgnore
public class CommonOaController {
	
	@Resource
	private CommonOaService commonoaService;
	

	@RequestMapping(value = "/auditedByTableName")
	@ResponseBody
	public Object auditedByTableName(CommonOa oa,String callback) {
		Result ret = new Result();
		try {
			ret = commonoaService.auditedByTableName(oa);
		} catch (Exception e) {
			ret.setMsg("操作失败");
			ret.setStatus("0");
			e.printStackTrace();
		}

		if (ApplicationUtils.isNotNull(callback)) {
			return new JSONPObject(callback, ret);
		} else {
			return ret;
		}


	}
}
